package 进制转换;

import java.math.BigInteger;
import java.util.Scanner;

public class 十六进制转八进制 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        BigInteger b = new BigInteger(a,16);
        String c = b.toString(8);
        System.out.println(c);


    }
}
